package com.gooboot.kadmin.base.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.gooboot.kadmin.base.constant.StatusConstant;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @description: 实体基类
 * @author 严富坤
 * @date 2020/8/30 12:25 上午
 * @version 1.0
 * @site http://www.gooboot.com
 */
@Data
public class SuperEntity<T extends Model> extends Model{
    private static final long serialVersionUID = -4851055130892178225L;

    /**
     * 唯一ID 主键
     */
    @TableId(value = "uid",type = IdType.ASSIGN_UUID)
    private String uid;

    /**
     * 字段状态值
     */
    private int status = StatusConstant.ENABLE;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date createTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /**
     * 创建者
     */
    private String createBy;

    /**
     * 更新者
     */
    private String updateBy;

    /**
     * 排序
     */
    private int sort;
}
